package com.zc.designmodel.behavioral.command;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: zhuCan
 * @date: 2020/4/14 14:12
 * @description:
 */
public class Broker {

  private List<Command> commands = new ArrayList<>();

  public void takeCommand(Command command){
    commands.add(command);
  }

  public void placeOrder(){
    commands.forEach(Command::execute);
  }
}
